const logInfo = require('../../../util/logInfo');
const logStep = require('../../../util/logStep');
module.exports = class PromptModuleAPI {
    constructor (creator) {
      this.creator = creator
      logInfo('cli [选项]的管理器，供多个组件公用，这里也定义了提示的类型和模式：injectFeature/injectPrompt/injectOptionForPrompt/onPromptComplete')
    }
  
    injectFeature (feature) {
      this.creator.featurePrompt.choices.push(feature)
    }
  
    injectPrompt (prompt) {
      this.creator.injectedPrompts.push(prompt)
    }
  
    injectOptionForPrompt (name, option) {
      this.creator.injectedPrompts.find(f => {
        return f.name === name
      }).choices.push(option)
    }
  
    onPromptComplete (cb) {
      this.creator.promptCompleteCbs.push(cb)
    }
  }
  